#include "CBase.h"
#include <cmath>
#include <windows.h>
//#include <gl/gl.h>
//#include <gl/glu.h>

TextureManager*		CBase::s_pTM;

CBase::CBase()
{
	m_Pos.Zero();
	m_Vel.Zero();
	m_unRefCount = 1;
	m_fTheta = 0.0f;
}

CBase::~CBase()
{
}

void CBase::Update(float fElapsed)
{
	m_Pos += m_Vel * fElapsed;
}

bool CBase::CheckCollision(CBase *pBase)
{
	return false;
}

float CBase::GetHeightSq()
{
	return Dot(m_Pos, m_Pos);
}

void CBase::CalculateTheta(void)
{
	Vec3 NormPos = m_Pos;
	NormPos.Normalize();
	m_fTheta = acos(Dot(NormPos, Vec3(0.0f, 1.0f, 0.0f)));

	if(m_Pos.x > 0.0f)
		m_fTheta = -m_fTheta;
}